package com.example.interactivehouse;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Window extends Activity{
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.window);
        final Button window = (Button)findViewById(R.id.window);
        final Button home = (Button)findViewById(R.id.homew);
        final Button open = (Button)findViewById(R.id.wopen);
        final Button close = (Button)findViewById(R.id.wclose);
//        final MediaPlayer win = (MediaPlayer)MediaPlayer.create(this, R.raw.opendoor);
//        window.setOnClickListener(new OnClickListener() {
//        	public void onClick(View v) { 
//        			window.setBackgroundResource(R.drawable.windowopen); 
//        		}        
//        	});
        open.setOnClickListener(new OnClickListener() {
        	public void onClick(View v) { 
//        		win.start();
        		window.setBackgroundResource(R.drawable.window2open); 
        	}        
        });
        close.setOnClickListener(new OnClickListener() {
        	public void onClick(View v) { 
        		window.setBackgroundResource(R.drawable.window2close); 
        	}        
        });
        home.setOnClickListener(new OnClickListener() {
        	public void onClick(View v) { 
        		home.setBackgroundResource(R.drawable.hometap); 
        		Intent i = new Intent(Window.this,InteraciveHouse.class);     
    			startActivity(i);
        	}        
        });
    }
}
